﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using NewDDSys.Entity;
using NewDDSys.IBLL;
using NewDDSys.IDAL;
using NewDDSys.Factory;
using NewDDSys.Utility;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Web_JBQR : System.Web.UI.Page
{
    private string num = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        btnOK.Attributes.Add("onclick", "javascript:if(confirm('" + "确认无误？" + "')== false) return false;");
        DataSet ds = BLLFactory.CreateJbBLL().SelectJb(Session["用户信息.部门"].ToString());
        if (ds == null)
            Response.Write(" <script   language=javascript> window.alert( ' 无交班信息！ ');</script> ");
        else
        {
            num = ds.Tables[0].Rows[0]["num"].ToString();
            txtShebei.Text = ds.Tables[0].Rows[0]["shebei"].ToString();
            txtYanxu.Text = ds.Tables[0].Rows[0]["yanxu"].ToString();
            txtInfo.Text = ds.Tables[0].Rows[0]["info"].ToString();
        }
        txtCS.Text = BLLFactory.CreateDxcBLL().DXCS(Session["用户信息.部门"].ToString());
        txtCS.Attributes["contentEditable"] = "false";
        txtDUN.Text = BLLFactory.CreateDxcBLL().JBDX(Session["用户信息.部门"].ToString());
        txtDUN.Attributes["contentEditable"] = "false";
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        txtShebei.Attributes["contentEditable"] = "false";
        txtYanxu.Attributes["contentEditable"] = "false";
        txtInfo.Attributes["contentEditable"] = "false";
        Response.Write(" <script   language=javascript> window.alert( ' 信息确认无误，接班！ ');</script> ");
    }
    protected void btnRepeat_Click(object sender, EventArgs e)
    {
        BLLFactory.CreateJbBLL().UpdateJb(num, txtShebei.Text.ToString(), txtYanxu.Text.ToString(), txtInfo.Text.ToString());
        BLLFactory.CreateJbBLL().UpdateXG(num, DateTime.Now.ToString());
        Response.Write(" <script   language=javascript> window.alert( ' 信息修改成功，如无异议请点击情况确认接班！ ');</script> ");
    }
    protected void btnDXC_Click(object sender, EventArgs e)
    {
        Response.Redirect("DXCJL.aspx");
    }
}
